import java.util.Scanner;

public class Main {
    public static int fun(int a){
        int b = 0;
        int c = 0;
        while (a != 0){
            c = a % 10;
            b = b * 10 + c;
            a /= 10;
        }
        return b;
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int x = scanner.nextInt();
        int i = 0, b = 0, c = 0, a = x;
        while(a > 0){
            a = a / 10;
            i++;
        }
        System.out.println(i);

        int num = fun(x);
        if (num == x){
            System.out.println("Y");
        }else {
            System.out.println("N");
        }

    }
}